﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace _20201212周末作业
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            string path = @"E:\Numbers.txt";
            using (FileStream streamread = File.OpenRead(path),
            streamwrite = File.Create(@"E:\Numbers2.txt"))
            {
                byte[] bytes = new byte[1024];
                while (true)
                {
                    int length = streamread.Read(bytes, 0, 1024);
                    if (length == 0)
                    {
                        break;
                    }

                    streamwrite.Write(bytes, 0, length);
                }
                Console.WriteLine("复制完成");
            }
        }
    }
}